package main

import "fmt"

func main() {
	arr := [5]byte{0, 1, 2, 3, 4}
	s1 := arr[0:4]
	s2 := arr[2:4]
	s3 := arr[:]
	s4 := append(s3, 5)
	printLenCap(s4)
	fmt.Printf("arr %v %p \n", arr, &arr)
	fmt.Printf("s1 %v %p \n", s1, s1)
	fmt.Printf("s2 %v %p \n", s2, s2)
	fmt.Printf("s3 %v %p \n", s3, s3)
	fmt.Printf("s4 %v %p \n", s4, s4)
}

func printLenCap(s []byte) {
	fmt.Printf("len:%v cap:%v \n", len(s), cap(s))
}

func newByteSlice() []byte {
	s1 := make([]byte, 5, 16)
	return s1
}
